Many nodes (e.g., computing platforms, smartphones, or network devices) communicate data via messages, e.g., Internet protocol (IP) messages. Receiving nodes typically must parse and analyze header information stored in the messages to accurately process the messages. For example, a receiving node may attempt to identify a related message protocol associated with a message. A message protocol may define the content or form of a message in a standardized manner, so that entities using the protocol can communicate with each other unambiguously. A message may have distinct parts with distinct functions. For example, a message may include a routing header that identifies the sender and intended receiver of the message, a payload section that includes the content of the message that is to be delivered, and a checksum that may be used to detect and possibly correct errors that may have been injected into the message while in transit. These distinct parts are commonly referred to as information elements (IEs).
A message protocol may define several different varieties or types of messages. These message types may share some common IEs, such as the routing header or checksum, but may also have IEs that are unique to each type of message. For example, each message may include a message type identifier so that the receiving entity may unambiguously determine which type of message it is receiving and thus know what IEs that message should contain. For each type of message, the message protocol may define not only what IEs that type of message should contain but also what order that the IEs should appear within the message.
An entity that receives messages that adhere to a message protocol may use a programming construct called a protocol tree to parse the received messages. Protocol trees may define one or more valid message formats and/or protocols. For example, a protocol tree may be utilized to determine whether a received message is associated with one or more various protocols, such as a hypertext transfer protocol (HTTP), a general message radio service (GPRS) tunneling protocol (GTP), a transmission control protocol (TCP), a user datagram protocol (UDP), a real-time transport protocol (RTP), an Internet control message protocol (ICMP), or other protocols. The following pseudo code represents some actions that might be taken by a parsing function that traverses a protocol tree for identifying the message as containing header information associated with a HTTP, TCP, UDP, IMCP, and/or other protocols.
1Receive message;2Treat as if an IP message, read octet for protocol_ID3IF protocol_id = “6” THEN4  perform additional steps to verify TCP and/or toidentify other related headers (e.g., HTTP, GTP, etc.)5ELSE IF protocol_id = “17” THEN6  perform additional steps to verify UDP and/or toidentify other related headers (e.g., GTP, RTP)7ELSE IF protocol_id = “1” THEN8  perform additional steps to verify ICMP and/orto identify other related headers9ELSE IF protocol_id = “INVALID” THEN10   perform additional steps to identify other (e.g.,non-IP) headers15 END IF
In the pseudo code shown above, the parsing function traverses the protocol tree in the order in which the branches exist within the tree. For example, the first branch may define conditions or logic for identifying and/or verifying a TCP header and/or other related headers (e.g., HTTP), the second branch may define conditions or logic for identifying and/or verifying a UDP header and/or other related headers, and so on through the list of possible message protocols. If the most commonly received message is a non-IP message, however, this means that for most messages the parsing function performs multiple separate and time consuming tests before it identifies the message as a non-IP message. In a conventional system that uses a protocol tree, the performance of the parsing function can vary greatly depending on the specific traffic received. Processing inefficiencies become more and more significant as the size of the protocol tree increases. For example, protocol trees that handle multiple protocols can be quite large and thus even more susceptible to this kind of inefficiency.
Accordingly, a need exists for methods, systems, and computer readable media for optimized message processing.